//
//  LBOrderDetailController.m
//  loveBeen
//
//  Created by 郭小双 on 16/11/23.
//  Copyright © 2016年 loveBeen. All rights reserved.
//

#import "LBOrderDetailController.h"
#import "LBOrderDetailCell.h"

@interface LBOrderDetailController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,weak)UITableView *tableView;
@end

@implementation LBOrderDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)setupUI{
    
    UIBarButtonItem *btnItem = [[UIBarButtonItem alloc]initWithTitle:@"投诉" style:UIBarButtonItemStylePlain target:self action:nil];
    
    self.navigationItem.rightBarButtonItem = btnItem;
    UISegmentedControl *segment = [[UISegmentedControl alloc]initWithItems:@[@"订单状态",@"订单详情"]];
    segment.selectedSegmentIndex = 1;
    [segment setWidth:60 forSegmentAtIndex:0];
    [segment setWidth:60 forSegmentAtIndex:1];
    
    self.navigationItem.titleView = segment;
    
    UITableView *tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    [self.view addSubview:tableView];
    self.tableView = tableView;
    tableView.delegate = self;
    tableView.dataSource = self;
    [tableView registerNib:[UINib nibWithNibName:@"LBOrderDetailCell" bundle:nil] forCellReuseIdentifier:@"orderCellID"];

    
    
    UIView *headView = [[[UINib nibWithNibName:@"OrderDetailsHeadView" bundle:nil]instantiateWithOwner:self options:0]lastObject];
    tableView.tableHeaderView = headView;
    
      UIView *footView = [[[UINib nibWithNibName:@"OrderDetailFootView" bundle:nil]instantiateWithOwner:self options:0]lastObject];
      tableView.tableFooterView = footView;
}




- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LBOrderDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"orderCellID" forIndexPath:indexPath];
    
    
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 10;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
